package com.view.components
{
    import beherit.preloaders.BasePreloader;
    
    import caurina.transitions.Tweener;
    
    public class Preloader extends BasePreloader
    {  
    	private var $l:PreloaderBar
    	 
        public function Preloader()
        {
             super();
        }
        override protected function $_init():void
        {
        	$l = new PreloaderBar();
        	$l.x = this.$_settings.width/2-$l.width/2;
        	$l.y = this.$_settings.height/2-$l.height/2;
            this.addChild($l);      
        }
        override protected function $_update(_n:Number):void
        {
        	$l.update(_n);
        }
        override protected function $_disableLoader():void
        {
        	removeChild($l);
        	$l = null;
        	Tweener.addTween(this,{alpha:0,time:3,onComplete:this.$_delete});
        }
                
    }
}